package ExtendDemo.demo07;

import java.io.*;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
       //创建socket对象
        Socket s=new Socket("192.168.0.101",10001);

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        //封装输出流对象
        BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
        String line;
        while ((line= br.readLine())!=null){
            if("886".equals(line)){
                break;
            }
//            OutputStream os = s.getOutputStream();
//            os.write(line.getBytes(StandardCharsets.UTF_8));
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        s.close();
    }
}
